package edu.nf.admin.controller.shop;

import edu.nf.admin.controller.BaseController;
import edu.nf.waimai.model.shop.Shop;
import edu.nf.waimai.service.shop.ShopService;
import edu.nf.waimai.service.shop.impl.ShopServiceImpl;
import org.nf.web.annotation.Model;
import org.nf.web.annotation.RequestMapping;
import org.nf.web.annotation.RequestParam;
import org.nf.web.servlet.View;
import org.nf.web.servlet.view.JsonView;

public class ShopController extends BaseController {
    private ShopService service = new ShopServiceImpl();

    /**
     * 查询商品进行分页
     * @param shop
     * @param page
     * @param limit
     * @return
     */
    @RequestMapping("/edu/nf/admin/controller/admin/shop/listShopPaging")
    public View listShopPaging(@Model Shop shop,int page, int limit){
        return new JsonView(success(service.listShopPaging(shop, page, limit)));
    }

    /**
     * 删除商家
     * @param shopId
     * @return
     */
    @RequestMapping("/edu/nf/admin/controller/admin/shop/delShop")
    public View delShop(@RequestParam("shopId") int shopId){
        return new JsonView(success(service.delShop(shopId)));
    }


}
